{% load bootstrap3 %}
<!DOCTYPE html>

<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width,initial-scale=1" >
        <title>学习笔记-小项目</title>
        {% bootstrap_css %}
        {% bootstrap_javascript %}
    </head>
    <body>
        <nav class="navbar navbar-default navbar-static-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" 
                    class="navbar-toggle collapsed" 
                    data-toggle="collapsed"
                    data-target="#navbar"  >

                    </button>

                    <a class="navbar-brand" href="{% url 'learning_logs:index' %}">
                        主页
                    </a>

                </div>
                
                <div id="navbar" class="navbar-collapse collapse" >
                    <ul class="nav navbar-nav">
                        <li><a href="{% url 'learning_logs:topics' %}" >我的话题</a></li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        {% if user.is_authenticated %}                            
                            <li><a>{{ user.username }}</a></li>
                            <li><a href="/admin">后台</a></li>
                            <li><a href="{% url 'users:logout_view' %}">注销</a></li>
                        {% else %}
                            <li><a href="{% url 'users:login' %}">登录</a></li>
                            <li><a href="{% url 'users:register' %}">注册</a></li>
                        {% endif %}
                    </ul>
                </div>

                <div class="page-header">
                    {% block header %} {% endblock header %}
                </div>
                <div>
                    {% block content %} {% endblock content %}
                </div>
            </div> <!-- end of container -->
        </nav>
    </body>
</html>


{% comment %}
<p>
    <a href="{% url 'learning_logs:index' %}" >首页</a>
    <a href="{% url 'learning_logs:topics' %}" >主题</a>    
    {% if user.is_authenticated %}
        <a href="{% url 'users:logout_view' %}" >注销</a>
    {% else %}
        <a href="{% url 'users:login' %}" >登录</a>
        <a href="{% url 'users:register' %}">注册</a>
    {% endif %}
    
    
</p>

{% if user.is_authenticated %}
    欢迎:{{ user }}
{% endif %}

{% block content %}

{% endblock content%}

{% endcomment  %}